
#ifndef HTTP_SERVER_H_
#define HTTP_SERVER_H_

#include <pthread.h>

struct server;
struct dict;
struct HttpRequest;
struct HttpResponse;

typedef void HttpCallBack(struct HttpRequest* request, struct HttpResponse* response);

typedef struct httpServer {
	struct server* pServer;
	HttpCallBack* onHttpCallBack;
	struct dict* sessionDict;
	pthread_mutex_t sessionDictLock;
}httpServer;

struct httpServer* initHttpServer(struct core* c, char *err, int port, char *bindaddr);
void destroyHttpServer(struct httpServer* hServer);

#endif /* HTTP_SERVER_H_ */
